import Vue from 'vue'
import LoadingVue from './loading'
import directive from './directive'
import service from './service'

const LoadingConstructor = Vue.extend(LoadingVue)
const LoadingDirective = directive(LoadingConstructor)
const LoadingService = service(LoadingConstructor)

LoadingDirective.install = function (Vue) {
  Vue.directive('Loading', LoadingDirective)
  Vue.prototype.$Loading = LoadingService
}

export default LoadingDirective
